import random

n = int(input("Напишите число выстрелов:"))
if n < 0:
    print("Пишите число больше нуля")
    exit()
r = 1
y = 0
g = 0
f = 0
e = 0
h = 0
while r == 1:
    a = random.randint(-100, 100)
    b = random.randint(-100, 100)
    if a > 0 and b > 0 and a < 6 and b < 6:
        g = g+1
    if a < 0 and b < 0 and a > -8 and b > -9:
        f = f+1
    if a > 0 and b < 0 and a < 6 and b > -9:
        e = e+1
    if a < 0 and b > 0 and a > -8 and b < 6:
        h = h+1
    y = y+1
    if y == n:
        r=0
        k = g+f+e+h
        print("Количество выстрелов:", n)
        print("Количество попаданий:", k)
